﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ReportS
{
    class MainWindowFunciton
    {
        public static string FormatCheckComboBoxValue(Xceed.Wpf.Toolkit.CheckComboBox box, string tableNameAndField)
        {
            if (string.IsNullOrEmpty(box.SelectedValue))
                return string.Empty;

            string result = " and (";
            foreach (string str in box.SelectedValue.Split(','))
                result += (tableNameAndField + "=" + str + " or ");

            result = result.Remove(result.Length - 3, 3);
            result += ")";
            return result;
        }
    }
}
